package com.supersit.greensproject.utils;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * 正则表达式工具类
 * Created by Administrator on 2016/8/4 0004.
 */
public class RegularExpressionUtils {
    /**
     * 邮箱帐号验证
     * @param email
     * @return
     */
    public static boolean checkEmail(String email) {
        Pattern pattern = Pattern.compile("[a-zA-Z0-9._-]+@[a-z]+\\.+[a-z]+");
        Matcher matcher = pattern.matcher(email);
        if (matcher.matches()) {
            //有效
            return true;
        } else {
            //无效
            return false;
        }
    }
}
